<div class="eject_con">
    <div id="warning"></div>
    <form method="post" target="iframe" action="{$action}">
      <ul class="info_table">
        <li>
          <h4>{$lang.payment_name}:</h4>
          <p class="new_style">{$payment.name|escape}</p>
        </li>
        <li>
          <h4>{$lang.payment_desc}</h4>
          <p>
            <textarea class="text" name="desc">{$payment.desc|escape}</textarea>
            <span>{$lang.payment_desc_desc}</span></p>
        </li>
        <li>
          <h4>{$lang.enabled}:{$payment.status}</h4>
          <p> {html_radios options=$yes_or_no checked=$payment.status name=status} </p>
        </li>
      </ul>
      
      <!--{if $payment.code eq 'cod'}-->
      <h3></h3>
      <ul class="info_table">
        <li>
          <h5>{$lang.add_cod_region}:</h5>
          <p>
          <div id="region">
            <input type="hidden" name="region_id" id="region_id" class="mls_id" />
            <input type="hidden" name="region_name" id="region_name" class="mls_names" />
            <select>
              <option>{$lang.select_pls}</option>
              {html_options options=$allregions}
            </select>
            <input class="btn" type="button" id="add_region_button" value="{$lang.add}" />
          </div>
          </p>
        </li>
        <li>
          <h5>{$lang.cod_regions}:</h5>
          <div class="zone" id="current_regions"> 
            <!--{foreach from=$payment.regions item=item key=key}-->
            <label id="region{$key}">
              <input type="checkbox" checked="true" name="regions[{$key}]" value="{$item}" />
              &nbsp;{$item}<a href="javascript:;" class="delete" onclick="del_region({$key})">{$lang.drop}</a></label>
            <!--{/foreach}--> 
            
          </div>
        </li>
      </ul>
      <!--{/if}-->
      
      <div class="submit">
        <input type="submit" class="btn" value="{$lang.submit}" />
      </div>
    </form>
</div>
<!--{if $payment.code eq 'cod'}--> 
<script>
$(function(){
   regionInit("region");
   $('#add_region_button').click(function(){
        var region_id = $('#region_id').val();
        var region_name = $('#region_name').val();
        if(!region_id || !region_name){
            return;
        }
        if($('#region_' + region_id).length == 0){
            $('#current_regions').append($('<label id="region' + region_id + '"><input type="checkbox" checked="true" name="regions['+region_id+']" value="' + region_name + '" />&nbsp;' + region_name + '<a href="javascript:void(0);" class="delete" onclick="del_region('+region_id+')">{$lang.drop}</a></label>'));
        }
   });
});
function del_region(region_id){
    $('#region'+region_id).remove();
}
</script> 
<!--{/if}-->